
type IDType = number | string
function prinID(id: IDType){

}

// instanceof  判断实例,   ---instance就是实例的意思

function printTime(time: string | Date){
    if(time instanceof Date){
        console.log(time.toUTCString());
    }else{
        console.log(time);
    }
}

type Fish = {
    swimming: ()=> void
}

type Dog = {
    running: () => void
}

function walk(animal: Fish | Dog) {
    
}